package com.itheima;

import com.aliyuncs.DefaultAcsClient;
import com.itheima.autoconfig.aipFace.AipFaceProperties;
import com.itheima.autoconfig.aipFace.AipFaceTemplate;
import com.itheima.autoconfig.huanXin.HuanXinProperties;
import com.itheima.autoconfig.huanXin.HuanXinTemplate;
import com.itheima.autoconfig.huawei.HuaWeiUGCProperties;
import com.itheima.autoconfig.huawei.HuaWeiUGCTemplate;
import com.itheima.autoconfig.oss.OssProperties;
import com.itheima.autoconfig.oss.OssTemplate;
import com.itheima.autoconfig.sms.SmsProperties;
import com.itheima.autoconfig.sms.SmsTemplate;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

//短信发送配置类
@Configuration
//加载短信配置
@EnableConfigurationProperties({SmsProperties.class,
        OssProperties.class,
        AipFaceProperties.class,
        HuanXinProperties.class,
        HuaWeiUGCProperties.class,})
public class TanhuaAutoConfiguration {
    @Bean//存入ioc容器
    public SmsTemplate smsTemplate(SmsProperties smsProperties) {
        return new SmsTemplate(smsProperties);
    }

    @Bean
    public OssTemplate ossTemplate(OssProperties ossProperties) {
        return new OssTemplate(ossProperties);
    }

    @Bean
    public AipFaceTemplate aipfaceTemplate(AipFaceProperties aipFaceProperties) {
        return new AipFaceTemplate(aipFaceProperties);
    }

    @Bean
    public HuanXinTemplate huanXinTemplate(HuanXinProperties huanXinProperties) {
        return new HuanXinTemplate(huanXinProperties);
    }

    @Bean
    public HuaWeiUGCTemplate huaWeiUGCTemplate(HuaWeiUGCProperties huaWeiUGCProperties) {
        return new HuaWeiUGCTemplate(huaWeiUGCProperties);
    }

}
